package com.jnshu.tools.resultUtils;

/**
 * PageBean继承ResultBean，主要作用是返回分页的一些数据给前端
 * @param <T>
 */
public class PageBean<T> extends ResultBean {

    //当前页数
    private Integer pageNum;
    //每页显示数据量
    private Integer pageSize;
    //查询总记录数
    private long totalCount;

    public PageBean() {
    }

    public PageBean(Integer code,String messge, Integer pageSize,long totalCount,T data){
        super(code,data);
        this.pageSize=pageSize;
        this.totalCount=totalCount;
    }

    public PageBean(Integer code) {
        super(code);
    }

    public PageBean(Integer code, long totalCount, T data){
        super(code,data);
        this.totalCount=totalCount;
    }

    public PageBean(Integer code,Integer pageNum,Integer pageSize,long totalCount, T data) {
        super(code,data);
        this.pageNum=pageNum;
        this.pageSize=pageSize;
        this.totalCount=totalCount;
    }

    public PageBean(Integer code,String message,Integer pageNum,Integer pageSize,long totalCount,T data){
        super(code,message,data);
        this.pageNum=pageNum;
        this.pageSize=pageSize;
        this.totalCount=totalCount;
    }

    public Integer getPageNum() {
        return pageNum;
    }

    public void setPageNum(Integer pageNum) {
        this.pageNum = pageNum;
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }

    public Long getTotalCount() {
        return totalCount;
    }

    public void setTotalCount(Long totalCount) {
        this.totalCount = totalCount;
    }

    @Override
    public String toString() {
        return "PageBean{" +
                "pageNum=" + pageNum +
                ", pageSize=" + pageSize +
                ", totalCount=" + totalCount +
                "}"+super.toString();
    }
}
